package com.agnes.network;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.*;

import java.util.Map;

/**
 * Desc:   API接口
 * Creator ling
 * Date:   2017/9/8 0008 10:28
 */

public interface ApiService {

    @FormUrlEncoded
    @POST
    Observable<String> post(@Url String path, @FieldMap Map<String, Object> params);

    @POST
    Observable<String> post(@Url String path, @Body RequestBody requestBody);

    @POST
    Observable<String> post(@Header("loginToken") String loginToken, @Url String path, @Body RequestBody requestBody);

    @GET
    Observable<ResponseBody> get(@Url String path, @QueryMap Map<String, Object> params);

    @GET
    Observable<String> get(@Header("loginToken") String loginToken, @Url String path, @QueryMap Map<String, Object> params);
}
